package com.shrw.duke.serialport.utils;

import android.util.Log;

import org.junit.Test;

import java.util.Arrays;

import static org.junit.Assert.*;

/**
 * Created by rw-duke on 2018/4/2.
 */
public class PortDataTrimUtilsTest {
    @Test
    public void getInstance() throws Exception {

    }

    @Test
    public void add() throws Exception {

    }

    @Test
    public void get() throws Exception {
        String d = "46020304050030D1B6E37401A2001300000000000000000001889988FE7044201C00B370192715003B090000FF2EFFFF51";
        String[] data = {
                "46020304050030D1B6E37401A2001300000000000000000001889988FE7044201C00B370192715003B090000FF2EFFFF51",
                "020304050030D1B6E374019D001300000000000000000001889988FE7044201C00B36A192715003B090000FF2EFFFF46",
                "020304050030D1B6E374019E001300000000000000000001889988FE7044201C00B36B192715003B090000FF2FFFFF49",
                "020304050030D1B6E374019F001300000000000000000001889988FE7044201C00B36C192715003B090000FF2EFFFF4A",
                "020304050030D1B6E37401A0001300000000000000000001889988FE7044201C00B36D192715003B090000FF2EFFFF4C",
                "020304050030D1B6E37401A1001300000000000000000001889988FE7044201C00B36F192715003B090000FF2EFFFF4F",
                "020304050030D1B6E37401A2001300000000000000000001889988FE7044201C00B370192715003B090000FF2EFFFF51"
        };
        byte[] b = new byte[]{(byte)0x46,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x00,(byte)0x30,(byte)0xD1
                ,(byte)0xB6,(byte)0xE3,(byte)0x74,(byte)0x01,(byte)0xA2,(byte)0x00,(byte)0x13,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x11};

//        Log.e("get:", "get:"+Arrays.toString(b));
        System.out.println("get:"+Arrays.toString(b));
//        PortDataTrimUtils.getInstance().add(b);
        Log.e("get222","get222"+Arrays.toString(PortDataTrimUtils.getInstance().get()));
    }

}